package com.example.client.service;

import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * @Author: YAOZUN
 * @Date: Created in 17:01 2018/12/18 0018
 * @Description:
 */
@Service
public class RestService {

    public String getRest(String url){
        RestTemplate restTemplate = new RestTemplate();
        return restTemplate.getForObject(url,String.class);
    }

    public String postRest(String msg,String url){
        RestTemplate restTemplate = new RestTemplate();
        return restTemplate.postForObject(url,msg,String.class);
    }

    public List getRestBigMsg(String url){
        RestTemplate restTemplate = new RestTemplate();
        return restTemplate.getForObject(url,List.class);
    }

}
